//
//  UIViewController+SchemaNode.m
//  Pods
//
//  Created by sunhaiyan on 16/6/17.
//
//

#import "UIViewController+SchemaNode.h"
#import <objc/runtime.h>
#import "SHYSchemaManager.h"

@implementation UIViewController  (SchemaNode)
const static char kSHYAdditionalData;

- (void)setAdditionalDataDict:(NSDictionary *)additionalDataDict {
    objc_setAssociatedObject(self, &kSHYAdditionalData, additionalDataDict, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}

- (NSDictionary *)additionalDataDict {
    return objc_getAssociatedObject(self, &kSHYAdditionalData);
}

+ (BOOL)registerWithTabName:(NSString *)tabName moduleName:(NSString *)moduleName class:(Class)classz {
    return [[SHYSchemaManager defaultManager] registerWithTabName:tabName moduleName:moduleName class:classz];
}

- (NSURL *)schemaUrlForTabName:(NSString *)tabName moduleName:(NSString *)moduleName paramDict:(NSDictionary *)paramDict {
    return [[SHYSchemaManager defaultManager] schemaUrlForTabName:tabName moduleName:moduleName paramDict:paramDict];
}

@end
